package com.example.bidding.feign;

import com.example.common.entity.Rsp;
import com.example.common.pojo.User;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@FeignClient(value = "user", fallback = UserFeignFallBack.class)
public interface UserFeign {

    @PostMapping("getUserInfoById")
    public Rsp getUserInfoById(@RequestBody User user);

    @GetMapping("getUserInfo")
    public Rsp getUserInfo(@RequestHeader("Authorization") String token);

    @RequestMapping("subBalance")
    public int subBalance(@RequestBody User user, @RequestParam BigDecimal cost);

    //流标退款
    @RequestMapping("refund")
    public int refund(@RequestParam Integer borrowId);

    //满标加账户余额
    @RequestMapping("addBalance")
    public int addBalance(@RequestParam Integer id, @RequestParam BigDecimal cost);
}
